<template>
  <div class="head-box">
    <div class="left-box">
      <span class="title">{{ title }}</span>
      <span class="type">{{ type }}</span>
    </div>
    <div class="right-box" @click="getMore">
      <span class="change">更多</span>
      <van-icon name="arrow" size="12" color="#061B41" />
    </div>
  </div>
</template>

<script lang="ts" setup>
import { defineProps, defineEmits } from 'vue'

const props = defineProps({
  title: {
    type: String
  },
  type: {
    type: String
  }
})

const emit = defineEmits(['getMore'])

const getMore = () => {
  emit('getMore')
}
</script>

<style lang="scss" scoped>
.head-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(6, 27, 65, 0.75);
  background-color: #fff;
  padding: 10px 14px;

  .left-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    .title {
      position: relative;
      font-size: 16px;
      font-weight: bold;
      margin-bottom: 4px;
      padding-left: 8px;
      &::before {
        position: absolute;
        top: 2px;
        left: 0;
        content: '';
        width: 3px;
        height: calc(100% - 6px);
        display: inline-block;
        background-color: #459bf3;
      }
    }

    .type {
      font-size: 12px;
      font-weight: 400;
    }
  }

  .right-box {
    display: flex;
    align-items: center;
    .change {
      font-size: 12px;
      font-weight: 700;
      margin-right: 4px;
    }
  }
}
</style>
